const ANSI_COLOR = {
    reset: "0",
    bold: "1",
    black: "30",
    red: "31",
    green: "32",
    yellow: "33",
    blue: "34",
    magenta: "35",
    cyan: "36",
    white: "37",
    bgBlack: "40",
    bgRed: "41",
    bgGreen: "42",
    bgYellow: "43",
    bgBlue: "44",
    bgMagenta: "45",
    bgCyan: "46",
    bgWhite: "47"
};

function colorize(color) {
    return `\x1b[${color}m`;
}

function colorizeText(text, color) {
    return colorize(color) + text + colorize(ANSI_COLOR.reset);
}

module.exports = {
    ANSI_COLOR,
    colorize,
    colorizeText
};